package com.cykj.shop.controller;

/**
 * @BelongsProject: Cykj-Order-System
 * @BelongsPackage: com.cykj.shop.controller
 * @Author: cwx
 * @CreateTime: 2025/9/1 2:41
 * @Description:
 * @Version: 1.0
 */

import com.cykj.common.core.domain.R;
import com.cykj.shop.domain.vo.BsAppraise;
import com.cykj.shop.service.BsAppraiseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * <p>
 * 评价表 前端控制器
 * </p>
 *
 * @author
 * @since
 */
@RestController
@RequestMapping("/appraise")
public class BsAppraiseController {

    @Autowired
    private BsAppraiseService bsAppraiseService;

    /**
     * 根据店铺ID查询评价列表
     * @param shopId 店铺ID
     * @return 评价列表
     */
    @GetMapping("/shop/{shopId}")
    public R<List<BsAppraise>> getAppraisesByShopId(@PathVariable Long shopId) {
        List<BsAppraise> appraises = bsAppraiseService.getAppraisesByShopId(shopId);
        return R.ok(appraises);
    }

}
